﻿<html>
<head>
<title>Modify page</title>
</head>
<body>
<H1>修改 和 刪除頁面</H1>
<?php

if($TagID != NULL){
	$link=mysql_connect("localhost", "root" ,"1123");
	$result = mysql_db_query("dd","select*
										 from staff
										 where id = '".$TagID."'"); //name要符合SQL字串方式傳送 = 'name'
	
	list($a, $b, $c, $d, $e, $f)= mysql_fetch_row($result);
	//標題
	//<form><input type="text" name="_ID" value=$a ></form>
	echo "***以下為 ID=$a 的資料***</br></br>";
	$main .='<form method="POST" action="ModifyResult.php" >
			 <a href="deleteResult.php?deleteID='.$a.'" ;>刪除 ID='.$a.' 此筆資料</a></br>
			 <table width="300" border="solid" >
			 <tr><td align="center">欄位</td><td align="center">修改</td></tr>
			 <tr><td align="center" class="bodyText">ID			</td><td>'.$a.'<input type="hidden" name="_ID" value='.$a.' ></td></tr>
			 <tr><td align="center" class="bodyText">Name		</td><td><input type="text" name="_Name"     value='.$b.' ></td></tr>
		     <tr><td align="center" class="bodyText">Gender		</td><td><input type="text" name="_Gender"   value='.$c.' ></td></tr>
			 <tr><td align="center" class="bodyText">Birthday	</td><td><input type="text" name="_Birthday" value='.$d.' ></br>(輸入格式:yyyy-mm-dd)</td></tr>
			 <tr><td align="center" class="bodyText">Address	</td><td><input type="text" name="_Address"  value='.$e.' ></td></tr>
			 <tr><td align="center" class="bodyText">Salary		</td><td><input type="text" name="_Salary"   value='.$f.' ></td></tr>
			 </table>
			 
			 <input type="submit" value="傳送修改"></br>
			 
			 </form>';
		//<input type="hidden" name="_ID" value='.$a.' > =>type="hidden"即不顯示但會POST值
	echo $main;
	
}
?>

</br><a href="searchResult.php"> 返回上一頁</a>
</body>
</html>